from flask import Blueprint
from . import view
# 注册蓝图
user_blueprint = Blueprint('user', __name__)
# 注册
user_blueprint.add_url_rule(rule='/register', methods=['POST'], view_func=view.register)

# 登录
user_blueprint.add_url_rule(rule='/login', methods=['POST'], view_func=view.login)

# 用户信息
user_blueprint.add_url_rule(rule='/userInfo', methods=['Get'], view_func=view.userInfo)

# 更新信息
user_blueprint.add_url_rule(rule='/update', methods=['PUT'], view_func=view.update)

# 更新头像
user_blueprint.add_url_rule(rule='/updateAvatar', methods=['PATCH'], view_func=view.avatar)

# 更新密码
user_blueprint.add_url_rule(rule='/updatePwd', methods=['PATCH'], view_func=view.updatePwd)

# 通过token获取当前登录用户信息
user_blueprint.add_url_rule(rule='/get/login', methods=['GET'], view_func=view.getLoginUser)

# 管理员添加用户
user_blueprint.add_url_rule(rule='/add', methods=['POST'], view_func=view.addUser)

# 管理员删除用户
user_blueprint.add_url_rule(rule='/delete', methods=['DELETE'], view_func=view.deleteUser)

# 管理员更新用户
user_blueprint.add_url_rule(rule='/updateUser',methods=['POST'], view_func=view.updateUser)

# 管理员查看用户信息
user_blueprint.add_url_rule(rule='/get',methods=['GET'], view_func=view.getUserById)

# 管理员查看用户列表
user_blueprint.add_url_rule(rule='/list/page',methods=['POST'], view_func=view.listUserByPage)

# 普通用户查看用户列表
user_blueprint.add_url_rule(rule='/list/page/vo',methods=['POST'], view_func=view.listUserVoPage)